package weaver.interfaces.hitech.duss.action;

import weaver.conn.RecordSet;
import weaver.general.BaseBean;
import weaver.general.Util;
import weaver.interfaces.hitech.duss.utils.HitechUtil;
import weaver.interfaces.hitech.duss.utils.ZCO_ORDER_BUDGET;
import weaver.interfaces.workflow.action.Action;
import weaver.soa.workflow.request.RequestInfo;

import java.util.List;
import java.util.Map;

/**
 * @Title: ecology-9-demo
 * @Company: 泛微软件
 * @author: weaver.Dusongsong
 * @version: 1.0
 * @CreateDate: 2022/03/08
 * @Description: 工程采购/施工合同变更审批流程
 * @ModifyLog:
 **/

/**
 * @Description: 部门科目汇总流程同步科目预算中间表
 * @Param:
 * @return:
 * @Author: Dusongsong
 * @Date: 2022/03/08
 */
public class WeaBmkmhzAction extends BaseBean implements Action {
    @Override
    public String execute(RequestInfo requestInfo) {
        RecordSet rs = new RecordSet();
        String requestid = requestInfo.getRequestid();
        String tablename = requestInfo.getRequestManager().getBillTableName();
        String workflowid = requestInfo.getWorkflowid();
        writeLog( "-----WeaBmkmhzAction-----" + requestid );
        try {
            rs.executeQuery( "select bznf,bzksyf,bbh,order1,bmsbm,bmmc from " + tablename + " where requestid=?", requestid );
            rs.next();
            String bbh = Util.null2String( rs.getString( "bbh" ) );
            String bznf = Util.null2String( rs.getString( "bznf" ) );
            String bzksyf = Util.null2String( rs.getString( "bzksyf" ) );
            String order1 = Util.null2String( rs.getString( "order1" ) );
            String kmbms = HitechUtil.getKmbmList( order1 );

            List<Map<String, String>> mapList = HitechUtil.getYsjcje( bbh );
            Map<String, String> resutlMap = ZCO_ORDER_BUDGET.execute( "1", bznf, mapList );

            return Action.SUCCESS;
        } catch (Exception e) {
            e.printStackTrace();
            writeLog( "异常参考:" + e );
            requestInfo.getRequestManager().setMessageid( "111111" );
            requestInfo.getRequestManager().setMessagecontent( "Action接口异常！" );
            return Action.FAILURE_AND_CONTINUE;
        }
    }

}
